#-*-coding:utf-8 -*-

import numpy as np
import matplotlib.pyplot as plt

# 线性可分数据
np.random.seed(0)

X1 = np.random.randn(20,1)+2 ;
Y1 = np.random.randn(20,1)+1

X2 = np.random.randn(23,1)-1.5
Y2 = np.random.randn(23,1)-1

plt.figure(figsize=(8, 6))
plt.scatter(X1, Y1, marker='x',color='blue', alpha=0.7, label='x')
plt.scatter(X2, Y2, marker='o',color='green', alpha=0.7, label='o')



plt.plot([1,2],[-3,4], '-', color='red')
plt.plot([1,2],[2,1], '-', color='green')
plt.plot([1,2], '-', color='blue')



plt.show()